﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
     <title>@ViewBag.Title</title>
    <link href="/Content/FrontEnd/css/css.css" rel="stylesheet" type="text/css" />
    <link href="/Content/FrontEnd/css/paging.css" rel="stylesheet" type="text/css" />
    <script src="/Content/FrontEnd/js/jquery-1.6.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#category ul li").hover(function () {
                $(this).addClass('active');
                $(this).children('ul').stop(true, true).slideToggle();
            }, function () {
                $(this).removeClass('active');
                $(this).children('ul').stop(true, true).slideToggle();
            })
            $('.item-news .avatar-link').attr('href', function () {
                return $(this).parents('.item-news').find('.title a:first').attr('href');
            });
            $('.delete-post').click(function () {
                return confirm('Do you want delete the post?');
            });
        })
        $(window).load(function () {
            showMessage('@Html.Action("GetMessage", "Base")');
        });
        function showMessage(message) {
            message = message.toString();
            if ($.trim(message) != "") {
                $('#loading-panel').css('display', 'none');
                if (message.indexOf('[msg]') == 0) {
                    message = message.substring(5);
                }
                var s = message.split('[msg]');
                for (i in s) {
                    alert(s[i]);
                }
            }
        }
    </script>
</head>
<body>
    <div id="wrap">
        <div id="head-wrap">
            <a href="#" id="logo">
                <img alt="downpublic.com" src="/Content/FrontEnd/images/logo.png" title="logo" /></a>
            @Html.Partial("_Menu")
        </div>
        <div id="content-wrap" class="clearfix">
            @Html.Action("feListCategory", "Category")
            <div id="main-content-wrap">
                @RenderBody()
            </div>
            <div id="nav-content-wrap">
                @if (User.Identity.IsAuthenticated)
                {
                    <div class="box-infouser clearfix">
                        @Html.Action("GetAvatar", "Account")
                        <a href="/myprofile" class="user">@User.Identity.Name</a>
                        <a href="/create" class="addnews">Add New Post</a>
                        @Html.ActionLink("Logout!", "logout", "home", null, new { @class = "logout" })
                    </div>
                }
                else
                {
                    using (Html.BeginForm("Login", "Home"))
                    {
                    <div id="box-login">
                        <div id="user-name">
                            <input type="text" name="Username" />
                        </div>
                        <div id="pass-word" class="clearfix">
                            <input type="password" name="Password" />
                            <input alt="Login" type="image" src="/Content/FrontEnd/images/btnlogin.png" />
                        </div>
                        <b><a href="/register">Create Account</a></b>
                        <br />
                        <a href="/forgotpassword">Forgot your Password?</a>
                    </div>
                    }
                }
                <div id="top-poster">
                    <b>Top Poster</b>
                    <br />
                    @Html.Action("feGetTopPoster", "Account")
                </div>
            </div>
        </div>
        <div class="footer-wrap">
        </div>
    </div>
</body>
</html>
